#ifndef RECT_H
#define RECT_H
#include <tinyxml.h>
#include "type.h"
#include "SwfObject.h"
namespace swfstream {
class Rect: SwfObject {
public:
	uint8 n_bits;
	int x_min;
	int x_max;
	int y_min;
	int y_max;
	void print();
	static Rect* from_file(FILE* f);
	virtual TiXmlElement* toTiXmlElement() {
		TiXmlElement *r = new TiXmlElement("Rect");
		r->SetAttribute("n_bits", n_bits);
		r->SetAttribute("x_min", x_min);
		r->SetAttribute("x_max", x_max);
		r->SetAttribute("y_min", y_min);
		r->SetAttribute("y_max", y_max);
		return r;
	}
	/*
	 size_t size_in_file() const{
	 size_t r=5+n_bits*4;
	 if(r%8==0){
	 return r/8;
	 }else{
	 return r/8+1;
	 }
	 };
	 */
};

}

#endif
